package com.yunhe.day322.service.impl;

import com.yunhe.day322.dao.OrderAndTravellerDao;
import com.yunhe.day322.service.OrderAndTravellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderAndTravellerServiceImpl implements OrderAndTravellerService {
    @Autowired
    private OrderAndTravellerDao orderAndTravellerDao;
    @Override
    public void add(String orderId, List<String> travellerId) {

        for (String s : travellerId) {
            orderAndTravellerDao.add(orderId,s);
        }
    }

    @Override
    public void deleteOtsById(String id) {
      orderAndTravellerDao.deleteById(id);
    }

    @Override
    public void update(String orderId, List<String> travellerId) {
        for (String s : travellerId) {
            orderAndTravellerDao.update(orderId,s);
        }

    }


}
